package abtractTokens;

public class TokenTests {
	
	public static void main(String [] args) {
		// test for genericToken properties
		
		String test_string = "3";
		System.out.println("Testing on the string \"" + test_string + "\"");
		GeneralToken test_lit = new LiteralToken(test_string);
		System.out.println("Token type = " + test_lit.getType());
		System.out.println("Token value = " + test_lit.toString());
		
		test_string = "33";
		System.out.println("Testing on the string \"" + test_string + "\"");
		test_lit = new LiteralToken(test_string);
		System.out.println("Token type = " + test_lit.getType());
		System.out.println("Token value = " + test_lit.toString());
		
		test_string = "33.3333";
		System.out.println("Testing on the string \"" + test_string + "\"");
		test_lit = new LiteralToken(test_string);
		System.out.println("Token type = " + test_lit.getType());
		System.out.println("Token value = " + test_lit.toString());
		
		test_string = "*";
		System.out.println("Testing on the string \"" + test_string + "\"");
		GeneralToken test_op = new OperatorToken(test_string);
		System.out.println("Token type = " + test_op.getType());
		System.out.println("Token value = " + test_op.toString());
		System.out.println("Token operator = " + ((OperatorToken) test_op).getOperator());
		System.out.println("Token precedence = " + ((OperatorToken) test_op).getPrecidence());
		
		test_string = "(";
		System.out.println("Testing on the string \"" + test_string + "\"");
		test_op = new OperatorToken(test_string);
		System.out.println("Token type = " + test_op.getType());
		System.out.println("Token value = " + test_op.toString());
		System.out.println("Token operator = " + ((OperatorToken) test_op).getOperator());
		System.out.println("Token precedence = " + ((OperatorToken) test_op).getPrecidence());
		
		test_string = "*(";
		System.out.println("Testing on the string \"" + test_string + "\"");
		test_op = new OperatorToken(test_string);
		System.out.println("Token type = " + test_op.getType());
		System.out.println("Token value = " + test_op.toString());
		System.out.println("Token operator = " + ((OperatorToken) test_op).getOperator());
		System.out.println("Token precedence = " + ((OperatorToken) test_op).getPrecidence());
		
		test_string = "A2";
		System.out.println("Testing on the string \"" + test_string + "\"");
		GeneralToken test_cell = new CellToken(test_string);
		System.out.println("Token type = " + test_cell.getType());
		System.out.println("Token value = " + test_cell.toString());
		System.out.println("Token row = " + ((CellToken) test_cell).getRow());
		System.out.println("Token column = " + ((CellToken) test_cell).getColumn());
		
		test_string = "AA234";
		System.out.println("Testing on the string \"" + test_string + "\"");
		test_cell = new CellToken(test_string);
		System.out.println("Token type = " + test_cell.getType());
		System.out.println("Token value = " + test_cell.toString());
		System.out.println("Token row = " + ((CellToken) test_cell).getRow());
		System.out.println("Token column = " + ((CellToken) test_cell).getColumn());
		
		test_string = "abc234676789";
		System.out.println("Testing on the string \"" + test_string + "\"");
		test_cell = new CellToken(test_string);
		System.out.println("Token type = " + test_cell.getType());
		System.out.println("Token value = " + test_cell.toString());
		System.out.println("Token row = " + ((CellToken) test_cell).getRow());
		System.out.println("Token column = " + ((CellToken) test_cell).getColumn());
		
		Token[] token_array = new Token[5];
		token_array[0] =  (Token) test_op;
		token_array[1] =  (Token) test_cell;
		token_array[2] =  (Token) test_lit;
		
		
	
	}
	
	
}
